package com.gpt.article.service.impl.taskHandle.helper;

public class GptHelper {
    /**
     * 根据计算最大token上限
     * @return
     */
    public static Integer  calculateMaxToken(String tokenModelName){
        Integer maxToken = 0;
        switch (tokenModelName){
            case "gpt-3.5-turbo":
                maxToken = 4000;
                break;
            case "gpt-3.5-turbo-16k":
                maxToken = 15000;
                break;
            case "gpt-3.5-turbo-1106":
                maxToken = 15000;
                break;
            case "gpt-3.5-turbo-instruct":
                maxToken = 8000;
                break;
            case "gpt-4":
                maxToken = 8000;
                break;
            case "gpt-4-1106-preview":
                maxToken = 4000;
                break;
            case "gpt-4-vision-preview":
                maxToken = 8000;
                break;
            case "gpt-4-32K":
                maxToken = 32000;
                break;
            case "SparkDesk":
                maxToken = 8000;
                break;
            case "ERNIE-Bot":
                maxToken = 8000;
                break;
            case "ERNIE-Bot-turbo":
                maxToken = 8000;
                break;
            case "ERNIE-Bot-4":
                maxToken = 8000;
                break;
            case "chatglm-pro":
                maxToken = 8000;
                break;
            default:
                maxToken = 2000;
                break;
        }
        return maxToken;
    }
}
